package com.dr.springboot.starter.controller;

import com.dr.springboot.starter.exception.MVCException;
import com.dr.springboot.starter.exception.RestException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by rui on 2018/7/25.
 */
@Controller
@RequestMapping("/exceptionhandle")
public class ExceptionController {

    @GetMapping("/rest")
    @ResponseBody
    public String rest() throws Exception {
        throw new RestException();
    }

    @GetMapping("/mvc")
    public String mvc() {
        throw new MVCException(500);
    }
}
